package com.lian.community.entity.post;

import com.qcloud.cos.utils.StringUtils;

public class Post {
    private Integer id;
    private String createTime;
    private String content;
    private String title;
    private Integer deleted;

    public boolean createValid(int contentLength, int titleLength){
        boolean flag = StringUtils.isNullOrEmpty(content) || StringUtils.isNullOrEmpty(title);
        if(flag){
            return false;
        }
        flag = content.length() > contentLength || title.length() > titleLength;
        if(flag){
            return false;
        }
        return true;

    }

    public Post() { }


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }

    @Override
    public String toString() {
        return "PostPO{" +
                "id=" + id +
                ", createTime='" + createTime + '\'' +
                ", content='" + content + '\'' +
                ", title='" + title + '\'' +
                ", deleted=" + deleted +
                '}';
    }
}
